home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
Asymptote Demo
/
Examples
/
Utility Scripts
/
planck
< prev
next >
Wrap
Text File
|
1994-05-07
|
609b
|
25 lines
% PLANCK T(K) [ergs s-1 cm-2 Hs-1 steradians-1]
% Calculate a Planck function
% ARGUMENT:
% T -- Temperature (in Kelvins)
%
% DESCRIPTION:
% Use the frequencies (Hz) stored in the X vector and the specified
% temperature T (Kelvins) to calculate the Planck function
% Store the result in Y
hide
constants % Load some basic physical constants
rpn <x h * k &1 * / dup % Calculate the argument to the exponential
% Check to see to see if we might overflow the e^x function:
rpn 5000 < xy * e^x 1 - 1 xy
rpn dup 0 = + / dup 1 ≠ *
% Multiply by the rest of the terms
rpn 2 * h * <x 3 y^x * c dup * / >y